using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace Terra.WebApi.Areas.Mobile.Controllers
{
    /// <summary>
    /// 移动端用户控制器
    /// </summary>
    [Area("Mobile")]
    [Route("api/mobile/[controller]")]
    [ApiController]
    [Authorize]
    public class UserController : ControllerBase
    {
        /// <summary>
        /// 获取用户个人信息
        /// </summary>
        /// <returns>用户信息</returns>
        [HttpGet("profile")]
        public IActionResult GetProfile()
        {
            return Ok(new
            {
                userId = "mobile_user_001",
                nickname = "移动用户",
                avatar = "https://example.com/avatar.jpg",
                lastLoginTime = DateTime.Now,
                deviceInfo = new
                {
                    platform = "iOS/Android",
                    deviceId = "DEVICE_ID_001",
                    appVersion = "1.0.0"
                }
            });
        }

        /// <summary>
        /// 更新设备信息
        /// </summary>
        /// <returns>更新结果</returns>
        [HttpPost("device")]
        public IActionResult UpdateDeviceInfo()
        {
            return Ok(new
            {
                success = true,
                message = "设备信息更新成功"
            });
        }
    }
}